import axios from "axios";

// 获取当前持有基金信息
export const getCurFundAPI = async () => {
    return (await axios.get("/api/getCurFund")).data;
}

// 删除已持有基金，传值基金代码，修改数据库对应基金代码的本金为0
export const deleteFundAPI = async (params:any) => {
    return (await axios.post("/api/deleteFund", params)).data;
}

// 获取资金列表数据
export const getAssetListDataAPI = async (params?:any) => {
    return (await axios.post("/api/assetListData", params)).data;
}

// 新建固资记录
export const createAssetRecordAPI = async (params:any) => {
    return (await axios.post("/api/createAssetRecord", params)).data;
}

// 获取所有基金信息
export const getAllFundInfoAPI = async () => {
    return (await axios.get("/api/getAllFund")).data;
}

// 基金信息补充部分，点击确定后，将基金信息补充到数据库中
export const updateFundInfoAPI = async (params:any) => {
    return (await axios.post("/api/updateFund", params)).data;
}